package com.ht.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ht.domain.bo.TbDepartmentBO;
import com.ht.domain.po.TbDepartment;
import com.ht.mapper.TbDepartmentMapper;
import com.ht.service.TbDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TbDepartmentServiceImpl implements TbDepartmentService {
    @Autowired
    private TbDepartmentMapper  tbDepartmentMapper;

    @Override
    public TbDepartmentBO queryTbDepartmentBydepartmentId(Long departmentId) {
        QueryWrapper q= new QueryWrapper();
        q.eq("id",departmentId);
        TbDepartment tbDepartment = tbDepartmentMapper.selectOne(q);
        TbDepartmentBO bo = new TbDepartmentBO();
        BeanUtil.copyProperties(tbDepartment,bo);
        return bo;
    }
}
